<template>
  <div>
    <el-table :data="tableData" style="width: 100%" >
      <el-table-column prop="name" label="菜式" width="180"></el-table-column>
      <el-table-column prop="num" label="数量" width="180"></el-table-column>
      <el-table-column prop="price" label="价格"> </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "OrderDetail",
  data() {
    return {
      tableData: [
        {
          name: "猪脚饭",
          num: "2",
          price: "20.00",
        },
      ],
    };
  },
  mounted() {
    //console.log(this.$route.query.id);
    let orderId = this.$route.query.id;
    this.$axios
      .post("/storeOrderDetail", {
        orderId,
      })
      .then((res) => {
        for (let t of res.data) {
          t.price = t.num * t.price;
        }
        this.tableData = res.data;
      });
  },
};
</script>

<style>
</style>